//
//  NSString+NSURL.m
//  XianjinXia
//
//  Created by Xianjinkd on 2017/6/2.
//  Copyright © 2017年 lxw. All rights reserved.
//

#import "NSString+NSURL.h"

@implementation NSString (NSURL)
- (NSString *)URLEncodedString {
    NSString *encodedString = (NSString *)CFBridgingRelease(CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault,
                                                                                                    (CFStringRef)self,
                                                                                                    (CFStringRef)@"!$&'()*+,-./:;=?@_~%#[]",
                                                                                                    NULL,
                                                                                                    kCFStringEncodingUTF8));
    return encodedString;
}
@end
